const Mock = require('Mockjs');
let data = Mock.mock({
    "list|4":[{
        "id":"@id",
        "txt":"@ctitle(2)",
        "children|20":[{
            "id":"@id",
            "txt":"@ctitle(6)",
            "src":"@image(100x100,@color)",
            "price|100-1000":0,
            "flag":false,
            "img|4-6":[{
                "src":"@image(100x100,@color)",
            }]
        }]
    }]
})

module.exports = {
    //...
    devServer: {
        compress: true,
        port: 9000,
        before(app){
            app.get('/list',(req,res)=>{
                res.send(data.list);
            })
        }
    },
};